package com.skywolf.chem.match.params.param;

import com.skywolf.chem.match.utils.LocalDateUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 报名人信息
 *
 * @Author sj
 * Date on 2021/9/28  9:05
 * @Version 1.0
 */
@Data
public class ApplyUserInfoParam {

    @ApiModelProperty(value = "报名key 更新时必传")
    private String key;

    @NotNull(message = "活动编号不能为空")
    @ApiModelProperty(value = "活动编号", required = true)
    private Long matchId;

    @NotNull(message = "组别编号不能为空")
    @ApiModelProperty(value = "组别编号", required = true)
    private Long matchGroupId;

    @Pattern(regexp = "^.{2,20}$", message = "姓名长度不合法")
    @NotBlank(message = "姓名不能为空")
    @ApiModelProperty(value = "姓名", required = true)
    private String name;

    @NotNull(message = "性别不能为空")
    @ApiModelProperty(value = "性别 0为女 1为男  2为不限")
    private Integer gender;

    @NotNull(message = "出生日期不能为空")
    @ApiModelProperty(value = "出生日期", required = true)
    @Pattern(regexp = "^\\d{4}-\\d{1,2}-\\d{1,2}", message = "生日格式错误")
    private String birthday;

    @NotBlank(message = "手机号码不能为空")
    @Pattern(regexp = "^1[3456789]\\d{9}$", message = "手机号码格式错误")
    @ApiModelProperty(value = "手机号码", required = true)
    private String phone;

    @NotBlank(message = "身份证号码不能为空")
    @Pattern(regexp = "(^\\d{15}$)|(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)", message = "身份证号码格式格式错误")
    @ApiModelProperty(value = "身份证号码", required = true)
    private String idCard;

    @NotBlank(message = "政治面貌不能为空")
    @ApiModelProperty(value = "政治面貌", required = true)
    private String politicsStatus;

    @NotBlank(message = "民族不能为空")
    @ApiModelProperty(value = "民族", required = true)
    private String nation;

    @ApiModelProperty(value = "是否为体育从事者 0不是 1是")
    private Integer sportsPractitioner;

    @ApiModelProperty(value = "职业")
    private String occupation;

    @NotBlank(message = "三级联动地址不能为空")
    @ApiModelProperty(value = "三级联动地址 采用-拼接（省-市-县)", required = true)
    private String address;

    @NotBlank(message = "详细地址不能为空")
    @ApiModelProperty(value = "详细地址", required = true)
    private String addressDetails;

    @ApiModelProperty(value = "紧急联系人姓名")
    private String emergencyContactName;

    @ApiModelProperty(value = "紧急联系人电话号码")
    private String emergencyContactPhone;

    @ApiModelProperty(value = "与本人关系")
    private String emergencyContactRelation;


    @ApiModelProperty(value = "自定义标签")
    private List<ApplyUserCustomTagModel> tagModels;

    /**
     * 自定义标签
     */
    @Data
    public static class ApplyUserCustomTagModel {
        @ApiModelProperty(value = "自定义标签键值")
        private String key;

        @ApiModelProperty(value = "自定义标签item值(如下拉框选项值)")
        private List<String> item;

        @ApiModelProperty(value = "用户输入/选中的值")
        private List<String> value;

        @ApiModelProperty(value = "是否必填")
        private String required;

        @ApiModelProperty(value = "标签类型")
        private String type;
    }


}
